// pages/gameChange/gameChange.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    //状态栏
    height: app.globalData.CustomBar,
    padding_top: app.globalData.CustomTitle,
    //电脑游戏列表
    computerGameList1: [{
        url: "https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/LOL.png?sign=f60417ea874a538fd63e395b7ff2fcd2&t=1624700651",
        name: "英雄联盟",
        id: "0"
      },
      {
        url: "https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/PUBG.png?sign=47f8d13824f86035c95bc5b6171d891f&t=1624700736",
        name: "刺激战场",
        id: "1"
      },
      {
        url: "https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/OverWatch.png?sign=b44b6cdb212660bc73db37373cbcfbc4&t=1624702857",
        name: "守望先锋",
        id: "2"
      }
    ],
    computerGameList2: [{
      url: "https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/CF.png?sign=590f4dc3ca158c1ca968e1650e108ef3&t=1624700755",
      name: "穿越火线",
      id: "3"
    }],
    //手机游戏列表
    mobileGameList: [{
      url: "https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/Honor%20of%20Kings.png?sign=045820fe3a7c8573cd1bea4f0c73093f&t=1624701769",
      name: "王者荣耀",
      id: "m0"
    }, {
      url: "https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/LOL_mobile.png?sign=f1c6abc4167fb3190cb49698f2df1a9d&t=1624701787",
      name: "英雄联盟",
      id: "m1"
    }, {
      url: "https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/Game%20For%20Peace.png?sign=1dafe26dba46238878cce737c44c9129&t=1624702151",
      name: "和平精英",
      id: "m2"
    }]
  },

  goback_userPermission() {
    wx.navigateBack({
      delta: 1,
    })
  },

  whichGame(e) {
    let pages = getCurrentPages();
    let prevPage = pages[pages.length - 2];
    prevPage.setData({
      rankId: e.currentTarget.dataset.id,
      userGames: e.currentTarget.dataset.game
    })
    wx.navigateBack({
      delta: 1,
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})